Add list lemmas and shorten some other proofs using them #721
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I needed some of these lemmas for a recent project and thought I would add them + try to shorten other proofs using them where possible.
The main result here that is useful to me is the
uniq_le_perm_eq
lemma, which seems to encompass the other lemmas that are there currently, provided you also have theperm_eq_uniq_impl
lemma. I know that these are derivable from the present lemmas, but this is not directly obvious (at least it wasn't to me). And I would say this is especially so since the lemma that currently comes closest touniq_le_perm_eq
, which isuniq_perm_eq_size
, uses more and stronger hypotheses than necessary (see the new proof, which clears one of the hypotheses and does not much more than directly applying a lemma with weaker hypothesis).The other, smaller lemmas on
drop
andbehead
I included have simply been annoying me in proofs (their absence, that is).